

<html>

<h2>
Introduction
</h2>

The SEP library is a small flexible numerical library that can aid you
with molecular dynamics simulations. There already exists many good
packages out there, like GROMAX and NAMD, that can do quite
advanced things. However, these packages does not provide you an 
easy way of customising your programs and "get your hands dirty". 
I believe that this is rather important for students who wish to learn 
about molecular simulations. Also, the library (rather than a finished
programme) allows you to extent the study in any direction you want:
You simply add your own functionality. Surely, this means that you need
some programming skills, but I have tried to keep the API as simple
as possible without compromissing the flexibility. The SEP library
is heavily inspired by D.C. Rapport's "The Art of Molecular
Dynamics simulations", Cambridge University Press. 
However, I hope that the library is more safe
(in the sense that global variables are minimised, for example) and
that the functions are more flexible. This should make this library
easier to hack. the library is written in ANSI C89 and a few 
features from C99. These features are supported by C compiler
from GNU Compiler Collection and Intel's C compiler and should not 
cause any problems.
 <p>
To mention some of the features:

<ul>
<li> Fully optimised algorithms for the force calculations
(neighbour-list and cell-list). 

<li> 2 dimensional and 3 dimensional systems can be simulated.

<li> Possibility of user supplied interaction potentials.

<li> Any kind of geometry, including no-flux boundaries.   

<li> Leap-frog, velocity Verlet and Gear's predictor-corrector integration
     schemes.

<li> Nose-Hoover thermostat (for NVT simulation).

<li> Pair interactions, lattice interactions, bond-stretching, 
     bending and torsion potentials are implemented. 

<li> Parallel molecular simulations is supported using MPI. 3
     dimensional systems only. 
</ul>

<h2>
Installation
</h2>
You should be able install the SEP library by:

<ul>
<li> Download the sep-XXX.tar.gz (XXX is the version number)
<li> Unpack by e.g: <tt>tar -zxvf sep-XXX.tar.gz</tt>. A new directory
     sep-XXX will be created.	
<li> Change directory to sep-XXX
<li> Type: <tt>./configure</tt>
<li> Type: <tt>make</tt>
<il> Type <tt>make test</tt> (optional)
<li> Type <tt>make install</tt> as root (optional) 
</ul>
Please, see the README file.

<h2>
A bit benchmarking
</h2>

It is typically the force evaluation that is the time consuming part
of any molecular dynamics simulation programme. The SEP library
provides the usual nearest neighbourlist optimisation algorithm for
evaluating pair interactions.  In principle this algorithm
yields an executing time, t<sub>ex</sub>, that scales linearly with
the number of particles, N. The figure below shows t<sub>ex</sub> from a
series molecular dynamics simulations (using the SEP library) as a
function of N. 
<p>
<img src="executing_single_scaled.jpg"> 
<p>
It might be worth noting that  t<sub>ex</sub> is very close to that
obtained using Rapaport's package. This is hardly surprising
knowing that the SEP library is using many of his algorithms. 
<p>

The SEP library also provide a parallel module for 3 dimensional
simulations. The algorithm is based on domain decomposition, such that
each process handles one part of the physical simulation box. In order
to decrease the communication overhead the domain decomposition is only
carried out in the x direction. This means that each process only
needs to communicate with two others. In order to decrease the
communication to cpu calculations ratio the x direction should then be
chosen to be the longest dimension when possible. In order to see 
how the system geometry effects the execution time two different
systems are simulated: a rectangular domain (system 1) and a cubic
domain (system 2). In system 1 the y and z direction are 10 particle
diameters (Lennard-Jones particles) and the x direction is allowed to
increase for different N. This is close to minimum communication to
cpu calculations ratio. In system 2 the domain lengths are equal
giving a maximum communication overhead. In
the following figure the speedup as a function of N is depicted, where
the speedup is defined as the serial executing time divided with the
parallel executing time. In the parallel programme two 1 cpu nodes are
used. 
<p>
<img src="speedup_scaled.jpg">
<p>
It is seen that for small N the speedup is poor since the
communication to cpu calculation ratio is relative high. The speedup
increases and reaches a plateau for higher N. The location of the
plateau is dependent of the system geometry and the speedup is
larger for system 1. 
<p>  

In the figure below t<sub>ex</sub> is plotted as a function of number
of nodes (1 cpu in each node). The data is for system 1 where N is
100.000.  
<p>
<img src="executing_scaled.jpg">
<p>
As we would like it to be: The executing time is decreasing.  Since
each process in the parallel universe is communicating with two 
other processes independent of the size of the system we would expect
that if the number of nodes increases the speedup increases
linearly as long as we are on the plateau discussed earlier.
This can be studied by defining the efficiency which is the
speedup divided with the number of nodes. 
The figure below shows the efficiency as a function of the number of
nodes for the same system as in figure above.
<p> 
<img src="effeciency_scaled.jpg">
<p>
The efficiency is almost constant indicating a linear speedup. 
<p>
Notice that parallel executing time on SMP machines may be
different from the above. This has not been tested yet. 

 
</html>
